<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:p="http://primefaces.org/ui"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:composite="http://java.sun.com/jsf/composite">

    <composite:interface>

        <composite:attribute name="enabledDisabled"/>   
        <composite:attribute name="nameDisabled"/> 
        <composite:attribute name="notesDisabled"/> 
        <composite:attribute name="streetDisabled"/>
        <composite:attribute name="cityDisabled"/>
        <composite:attribute name="regionDisabled"/>
        <composite:attribute name="zipCodeDisabled"/>
        <composite:attribute name="countryDisabled"/>

        <composite:attribute name="nameRequired"/>

    </composite:interface>

    <h:panelGrid columns="3"
                 columnClasses="columnWidth48, columnWidth4, columnWidth48"
                 width="90%"
                 style="margin-left: auto; margin-right: auto">

        <h:panelGrid columns="1"
                     columnClasses="columnWidth100"
                     rowClasses="rowAlign"
                     width="100%"> 

            <p:outputLabel value="#{bundle.Name}" 
                           for="name"/>

            <p:inputText id="name" 
                         style="width: 100%; margin-bottom: 2%"
                         value="#{addressController.selected.name}"
                         tabindex="01"
                         disabled="#{cc.attrs.nameDisabled}"
                         required="#{cc.attrs.nameRequired}"/>       

            <p:outputLabel value="#{bundle.Street}" 
                           for="street"/>

            <p:inputText id="street" 
                         style="width: 100%; margin-bottom: 2%"
                         value="#{addressController.selected.street}"
                         tabindex="03"
                         disabled="#{cc.attrs.streetDisabled}"/>    

            <p:outputLabel value="#{bundle.Region}" 
                           for="region"/>

            <p:inputText id="region" 
                         style="width: 100%"
                         value="#{addressController.selected.region}"
                         tabindex="05"
                         disabled="#{cc.attrs.regionDisabled}"/>        

        </h:panelGrid>    

        <p:spacer/>

        <h:panelGrid columns="1"
                     columnClasses="columnWidth100"
                     rowClasses="rowAlign"
                     width="100%">  

            <p:outputLabel value="#{bundle.ZipCode}" 
                           for="zipCode"/>

            <p:inputText id="zipCode" 
                         style="width: 100%; margin-bottom: 2%"
                         value="#{addressController.selected.zipCode}"
                         tabindex="02"
                         disabled="#{cc.attrs.zipCodeDisabled}"/>      

            <p:outputLabel value="#{bundle.City}" 
                           for="city"/>

            <p:inputText id="city" 
                         style="width: 100%; margin-bottom: 2%"
                         value="#{addressController.selected.city}"
                         tabindex="04"
                         disabled="#{cc.attrs.cityDisabled}"/>  

            <p:outputLabel value="#{bundle.Country}" 
                           for="country"/>

            <p:inputText id="country" 
                         style="width: 100%"
                         value="#{addressController.selected.country}"
                         tabindex="06"
                         disabled="#{cc.attrs.countryDisabled}"/>       

        </h:panelGrid>     

    </h:panelGrid>

    <h:panelGrid columns="1"
                 columnClasses="columnWidth100"
                 width="90%"
                 style="margin-left: auto; margin-right: auto">

        <p:outputLabel value="#{bundle.Notes}" 
                       for="notes"/>

        <p:inputText id="notes" 
                     style="width: 100%"
                     value="#{addressController.selected.notes}"
                     tabindex="07"
                     disabled="#{cc.attrs.notesDisabled}"/>      

    </h:panelGrid>  

    <p:dialog header="#{bundle.AdditionalInfo}"
              widgetVar="additionalInfoDialog" 
              resizable="false" 
              modal="true" 
              showEffect="fade"
              hideEffect="fade" 
              draggable="false"
              width="48%"
              style="margin-left: auto; margin-right: auto">

        <h:panelGrid columns="3"
                     columnClasses="columnWidth48, columnWidth4, columnWidth48"
                     width="90%"
                     style="margin-left: auto; margin-right: auto">

            <h:panelGrid columns="1"
                         columnClasses="columnWidth100"
                         rowClasses="rowAlign"
                         width="100%">

                <p:outputLabel value="#{bundle.Id}" 
                               for="id"/>

                <p:inputText id="id"
                             style="width: 100%; margin-bottom: 2%"
                             value="#{addressController.selected.id}"
                             disabled="true"/>         

                <p:outputLabel value="#{bundle.CreatedBy}" 
                               for="createdBy"/>

                <p:inputText id="createdBy" 
                             style="width: 100%; margin-bottom: 2%"
                             value="#{addressController.selected.createdBy.name}"
                             disabled="true"/>

                <p:outputLabel value="#{bundle.UpdatedBy}" 
                               for="updatedBy"/>

                <p:inputText id="updatedBy"   
                             style="width: 100%"
                             value="#{addressController.selected.updatedBy.name}"
                             disabled="true"/>         

            </h:panelGrid>

            <p:spacer/>

            <h:panelGrid columns="1"
                         columnClasses="columnWidth100"
                         rowClasses="rowAlign"
                         width="100%">

                <p:outputLabel value="#{bundle.Enabled}"
                               for="enabled"/>

                <p:selectBooleanCheckbox id="enabled"
                                         style="vertical-align: -22%; margin-bottom: 4%"
                                         value="#{addressController.selected.enabled}"
                                         disabled="#{cc.attrs.enabledDisabled}"/>        

                <p:outputLabel value="#{bundle.Created}" 
                               for="created"/>

                <p:inputText id="created"
                             style="width: 100%; margin-bottom: 2%"
                             value="#{addressController.selected.created}"
                             disabled="true">

                    <f:convertDateTime 
                        locale="#{localizationUtil.selected}" 
                        type="both"
                        pattern="#{localizationUtil.dateTimeFormatMediumPattern}" 
                        timeZone="#{localizationUtil.defaultTimeZone}"/>      

                </p:inputText>  

                <p:outputLabel value="#{bundle.Updated}" 
                               for="updated"/>

                <p:inputText id="updated"
                             style="width: 100%"
                             value="#{addressController.selected.updated}"
                             disabled="true">

                    <f:convertDateTime 
                        locale="#{localizationUtil.selected}" 
                        type="both"
                        pattern="#{localizationUtil.dateTimeFormatMediumPattern}" 
                        timeZone="#{localizationUtil.defaultTimeZone}"/>

                </p:inputText>         

            </h:panelGrid>    

        </h:panelGrid>

    </p:dialog>   

</html>